import type { RouteRecordRaw } from 'vue-router'
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */
/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/home/index.vue'),
    meta: {
      title: '首页'
    }
  },
  {
    path: '/category',
    name: 'Category',
    component: () => import('@/views/category/index.vue'),
    meta: {
      title: '分类'
    }
  },
  {
    path: '/worthtobuy',
    name: 'WathToBuy',
    component: () => import('@/views/worthtobuy/index.vue'),
    meta: {
      title: '值得买'
    }
  },
  {
    path: '/shopcart',
    name: 'ShopCart',
    component: () => import('@/views/shopcart/index.vue'),
    meta: {
      title: '购物车'
    }
  },
  {
    path: '/center',
    name: 'Center',
    component: () => import('@/views/center/index.vue'),
    meta: {
      title: '个人'
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/center/index.vue'),
    meta: {
      title: '登录',
      hidden: true
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/register/index.vue'),
    meta: {
      title: '注册',
      hidden: true
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: '404',
      hidden: true
    }
  },
  {
    /* 匹配任意的路由 必须最后注册 */
    path: '/:pathMatch(.*)',
    name: 'Any',
    redirect: '/404',
    meta: {
      hidden: true
    }
  }
]

/**
 * 定义动态路由
 */
export const allAsyncRoutes: Array<RouteRecordRaw> = []

/**
 * 定义任意路由
 */
export const anyRoute = {
  /* 匹配任意的路由 必须最后注册 */
  path: '/:pathMatch(.*)',
  name: 'Any',
  redirect: '/404',
  meta: {
    hidden: true
  }
}
